/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package homework7;

/**
 *
 * @author Administrator
 */
import java.util.Scanner;

public class MainG2 {
    public static void main(String[] args) {
        Scanner cin = new Scanner(System.in);
        int t;
        t = cin.nextInt();
        cin.nextLine();
        for (int i = 0; i < t; i++) {
            String a;
            a = cin.nextLine();
            String b[] = a.split("[ ]+");
            for (int j = 0; j < b.length; j++) {
                System.out.print(b[j].substring(0, 1).toUpperCase());
            }
            System.out.println();
        }
    }
}
